package cn.yj.cgs.dba.mapper;

import cn.yj.annotation.pagehelper.annotation.StartPage;
import cn.yj.annotation.pagehelper.page.Page;
import cn.yj.cgs.dba.entity.Integral;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author 永健
 * @since 2021-04-19 16:12:11
 */
public interface IntegralMapper extends BaseMapper<Integral> {
    @StartPage
    List<Integral> findList(@Param("map") Map<String, Object> map, @Param("page") Page<Integral> page);

    @Select("select id,user_code ,integral from tb_integral where user_code=#{userCode} for update")
    Integral selectIntegralByUserCodeForUpdate(String userCode);

    @Select("select integral from tb_integral where user_code=#{userCode} for update")
    BigDecimal selectIntegralByUserCode(String userCode);

}
